home *** CD-ROM | disk | FTP | other *** search
- Path: gate.net!not-for-mail
- From: feathers@gate.net (Michael Feathers)
- Newsgroups: comp.lang.ada,comp.lang.c++,comp.lang.c,comp.lang.modula3,comp.lang.modula2,comp.lang.eiffel
- Subject: Re: Hungarian notation
- Followup-To: comp.lang.ada,comp.lang.c++,comp.lang.c,comp.lang.modula3,comp.lang.modula2,comp.lang.eiffel
- Date: 10 Jan 1996 07:43:14 -0500
- Organization: CyberGate, Inc.
- Message-ID: <4d0c92$1va6@navajo.gate.net>
- References: <30C40F77.53B5@swsbbs.com> <marnoldDJEvtJ.1Lx@netcom.com> <4aleun$jlk@ns.RezoNet.NET> <marnoldDJMDBG.CFz@netcom.com> <4asnkr$7b0@solutions.solon.com> <4ath75$e7i@barnacle.iol.ie> <4b4kij$svt@news.microsoft.com> <dewar.819489496@schonberg> <4bd
- <4cc2b2$11jq@navajo.gate.net> <4cud8f$gup@news.netvision.net.il>
- NNTP-Posting-Host: navajo.gate.net
- X-Newsreader: TIN [UNIX 1.3 950824BETA PL0]
-
- Uri Simchoni (simchoni@netvision.net.il) wrote:
- : In article <4cc2b2$11jq@navajo.gate.net>, feathers@gate.net says...
- : >Where I work, all the truly portable code is written in terms of
- : >typedefs. We alter the typedefs in an include file to alter data
- : >sizes and performance characeristic, and our variant of Hungarian
- : >uses these type names.
- :
- : I'm trying to get used to the idea...
- :
- : What if you have a variable which contains the delay between two
- : operations in milliseconds. Do you make up a new type, say
- :
- : typedef unsigned MSEC
-
- I don't. I'm using typedefs, but only to decouple the code from
- the intrinsic types.
-
- I have LShortInteger, LInteger, and LLongInteger. And all code
- is written in terms of those types (and LShortReal, LReal, and
- LLongReal).
-
- All these typedefs are in a global header file. They are typdef-ed
- to any of the intrinsic types, with constraints like:
-
- sizeof (LShortInteger) <= sizeof (LInteger) <= sizeof (LLongInteger)
-
- Maximum and minium values are defined for each of these types also
- based on values in float.h and limits.h.
-
- In documentation, I call this a "virtualized type system."
-
- It comes in real handy when you want to alter the performance characteristics
- of code very easily. You can trade floats for doubles very easily for
- instance if you want faster computation on some architectures.
-
-
-